package aeolus.wind.spider.web.commons.vote;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import aeolus.wind.spider.biz.dataobject.Ability;
import aeolus.wind.spider.biz.dataobject.Identity;
import aeolus.wind.spider.biz.dataobject.Vote;

public class VoteView {

    /**
     * 它会根据被投票者为key,被投票者的投票项列表为value做map
     */
    private Map<String, VotedIdentity> voteByName;

    public Map<String, VotedIdentity> getVoteByName() {
        return voteByName;
    }

    public VoteView(List<Ability> abilityList, List<Identity> identities, Map<String, Vote> voteMap) {
        voteByName = new HashMap<String, VotedIdentity>();
        for (Identity identity : identities) {
            voteByName.put(identity.getName(), new VotedIdentity(identity.getName(), abilityList, voteMap));
        }
    }

}
